#include<stdio.h>
int main()
{
	int in,out;
	scanf("%d",&in);
	int a=in%10;
	int b=(in/10)%10;
	int c=in/100;
	out=100*a+10*b+c;
	printf("%d",out);
	return 0;
}
